home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Skunkware 5
/
Skunkware 5.iso
/
src
/
X11
/
tclMotif-1.4
/
tests
/
uil.test
< prev
Wrap
Text File
|
1995-06-29
|
2KB
|
90 lines
if {[string compare test [info procs test]] == 1} then \
{source defs}
# set VERBOSE 1
# set INTERACTIVE 1
set uil_test 1
global x
#############
# starts here
#############
xtAppInitialize -class List
. setValues -allowShellResize true
if {$_Tm_UIL} {
# we are compiled with UIL support
test uil-1.1 {uil compile} {
global x
if {[catch {exec uil hello.uil -o hello.uid}] != 0} {
set msg "no UIL compiler"
} else {
. mrmOpenHierarchy hello.uid
. mrmFetchWidget hello_main
set msg "uil compiler"
}
set msg
} {uil compiler}
if {$msg == "uil compiler"} {
test uil-2.1 {widget creation} {
global x
if {[info commands .hello_main.hello] != ""} {
set x "widget exists"
} else {
set x "widget not created"
}
} {widget exists}
if {$x == "widget exists"} {
# perform the rest of the tests
test uil-3.1 {uil callback} {
.hello_main.hello callActionProc Arm() \
-type ButtonPress \
-x 5 -y 5
set uil_test
} {0}
test uil-4.1 {setting uil widget resource} {
.hello_main.hello setValues -width 40
.hello_main.hello getValues -width w
set w
} {40}
test uil-5.1 {widget method for list} {
.hello_main.alist deleteAllItems
.hello_main.alist addItem abcd 0
.hello_main.alist getValues -items items
set items
} {abcd}
}
test uil-6.1 {fetch widget override} {
. mrmFetchWidgetOverride hello_main hello_second
if {[info commands .hello_second.hello] != ""} {
set x "widget exists"
} else {
set x "widget not created"
}
} {widget exists}
}
}
#############
# Finish up #
#############
if { ! $INTERACTIVE} {
if {[info commands .hello_main] != ""} {
.hello_main destroyWidget
}
} else {
. mainLoop
}